<html>
  <head>
    <title><%= @page_title %></title>
    <%= stylesheet_link_tag 'application' %>
    <link rel="shortcut icon" href="/favicon.ico" />
    <%= javascript_include_tag "prototype" %>
    <%= javascript_include_tag "application" %>
    <script language="javascript">
      <!--
      function go_to_spinner(url,update) {
<%= remote_javascript_function(
  :update => "'+update+'",
  :url => "'/partial'+url",
  :method => :get,
  :loading => "$(update).hide();$(update+'_spinner').show();",
  :complete => "$(update+'_spinner').hide();$(update).show();") %>
      }

      function go_to(url,update) {
<%= remote_javascript_function(
  :update => "'+update+'",
  :method => :get,
  :url => "'/partial'+url") %>
      }

      function go_to_url(url) {
        go_to_url_spinner(url); return;
      }

      function go_to_url_spinner(url) {
<%= remote_javascript_function(
  :update => "content",
  :method => :get,
  :url => "'/partial'+url",
  :loading => "$('content').hide();$('content_spinner').show();",
  :complete => "$('content_spinner').hide();$('content').show();") %>
      }

      function update_result(url) {
<%= remote_javascript_function(
  :update => "result",
  :url => "'/partial'+url",
  :method => :get,
  :loading => "$('result').hide();$('result_spinner').show();",
  :complete => "$('result_spinner').hide();$('result').show();") %>
      }
      //-->
    </script>
  </head>
  <body>
    <table width="800">
      <tr>
        <td style="text-align: right; margin-top: 0px;">
          <table>
            <tr>
              <td align="left" width="60">
                <%= link_to image_tag("home.jpg", :border=> "0", :height=>'30', :weidth=>'30'),  "/" %>
              </td>
              <td align="left" width="240">
                <font style="font-family: Verdana; font-size: 20pt; font-color: #000000;">
                  Trading on Rails
                </font>
                <br>
                <font style="font-family: Verdana; font-size: 8pt; font-color: #000000;">
                  Rättvis näthandel.
                </font>
              </td>
              <td align="right" width="500" style="vertical-align: top;">
                <table align="right">
                  <tr>
                    <td>
                      <%= top_menu_item(link_to "Hem", "/", :class => 'topmenu')  %>
                    </td>
                    <td width="3">
                    </td>
                    <td>
                      <%= top_menu_item(content_link "Mina sidor",
                        url_for(:controller => :private, :action => :show ),
                        :class => 'topmenu') %>
                    </td>
                    <td width="3">
                    </td>
                    <td>
                      <%= top_menu_item(content_link "Hjälp",
                        url_for(:controller => :help, :action => :show),
                        :class => 'topmenu') %>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <table>
            <tr>
              <td width="500">
                <%= render_remote_url(url_for(:controller => :search, :action => :view),"spinner_tiny") %>
              </td>
              <td width="300" class="smalltext">
                <%= render_remote_url(url_for(:controller => :user, :action => :info)) %>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td style="text-align: left;">
          <table align="left">
            <tr>
              <td>
                <%= menu_item(link_to "Köp",
                  url_for( :controller => :category, :action => :all ),
                  :onclick => "set_query(''); go_to_category('',''); return false;",
                  :class => 'menu') %>
              </td>
              <td width="3">
              </td>
              <td>
                <%= menu_item(content_link "Sälj",
                  url_for( :controller => :sell, :action => :new ),
                  :class => 'menu') %>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <table class="dottedborder" width="100%">
            <tr>
              <td class="regulartext" style="text-align: center; vertical-align: middle;">
                <%= spinner("result_spinner") %>
                <div id="result">
                  <%= yield(:result)%>
                </div>
                <div id="content" class="regulartext">
                  <%= render :partial=>"#{controller.sub_layout}" %>
                </div>
                <%= spinner("content_spinner") %>
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td class="smalltext" style="text-align: center;">
          Vi använder <%= link_to "cookies", "http://en.wikipedia.org/wiki/HTTP_cookie", :target => "_blank", :class => "smalltext" %>
          |
          Nyheter publiceras i <%= link_to "bloggen", "http://blog.tradingonrails.com/", :target => "_blank", :class => "smalltext" %>
          |
          Information om organisationen finns <%= content_link "här",
            url_for( :controller => :info, :action => :about ),
            :class => "smalltext" %>.
          <br />
          Copyright &copy; Tomas Bjerre 2009
        </td>
      </tr>
    </table>
  </body>
</html>

